/**
 * 
 */
package org.tigris.mappedlexer.io.implementation;

import java.io.*;

import org.tigris.mappedlexer.io.*;


/**
 * @author Administrator
 *
 */
public class FileCharOutputSequence implements CharOutputSequence {

	protected PrintStream printStream = null;

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	protected FileCharOutputSequence() {
		
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	public FileCharOutputSequence(String fileName) throws IOException {
		this.printStream = new PrintStream(fileName);
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	public FileCharOutputSequence(PrintStream ps) {
		this.printStream = ps;
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	public void append(char chr) {
		printStream.append(chr);
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	public void append(String stream) {
		printStream.append(stream);
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	@Override
	public String toString(){
		return printStream.toString();
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	public void close() {
		printStream.close();
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	public void prepend(String stream) {
		throw new UnsupportedOperationException();
	}

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	public void prepend(char chr) {
		throw new UnsupportedOperationException();
	}

}
